package com.angel.mocks.data.generator.dataGenerator;

import java.io.Serializable;
import java.util.Collection;

import com.angel.dao.generic.factory.DAOFactory;
import com.angel.dao.generic.interfaces.GenericDAO;
import com.angel.data.generator.interfaces.DataGenerator;

/**
 *
 * @author William
 */
public class LanguajeInternationalizerGenerator implements DataGenerator {

	private static final long serialVersionUID = 456392726459660147L;

	@SuppressWarnings("unchecked")
	public Class<? extends DataGenerator>[] getDependecesGenerators() {
        return (Class<? extends DataGenerator>[]) new Class[]{LanguajeGenerator.class};
    }

    public void generateData(Collection<Object> objects, DAOFactory daoFactory) {
//        PTDAOFactory ptDAOFactory = (PTDAOFactory) daoFactory;
//        Collection<Languaje> languajes = ptDAOFactory.getLanguajeDAO().findAllByActive();
//        int index = 0;
//        for(Languaje l: languajes){
//            Internationalizer languajeInternationalizer = new LanguageInternationalizer();
//            languajeInternationalizer.setOwner(l);
//            languajeInternationalizer.setName(l.getName());
//            if(index == 0){
//                languajeInternationalizer.setCurrent(Boolean.TRUE);
//            } else {
//                languajeInternationalizer.setCurrent(Boolean.FALSE);
//            }
//            objects.add(languajeInternationalizer);
//            index++;
//        }
    }

    public Class<? extends Object> getDataGeneratorClass() {
        return Object.class;
    }

	public GenericDAO<Object, Serializable> getGenericDAO() {
        //return (GenericDAO<Object, Serializable>) ApplicationContextSpring.createInstance().prepareApplicationContext().getBean("languajeDAO");
        return null;
    }
}